# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=ytnef
pkgver=1.9.3
pkgrel=0
pkgdesc="TNEF Stream Reader - for winmail.dat files"
url="https://github.com/Yeraze/ytnef"
arch="all"
license="GPL+"
depends=""
makedepends="autoconf automake libtool file"
install=""
subpackages="$pkgname-dev $pkgname-libs"
source="$pkgname-$pkgver.tar.gz::https://github.com/Yeraze/ytnef/archive/v$pkgver.tar.gz
	ytnef-pkgconfig.patch
	"
builddir="$srcdir"/ytnef-$pkgver

prepare() {
	default_prepare
	autoreconf -vif
}

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--disable-static
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make install DESTDIR="$pkgdir" includedir=/usr/include/libytnef
}

sha512sums="be0a46e79561a5ff34f812b892a781809606cc7e38c6bfed15bae7773f952b4b55aed0fa784922e72839121672c540496db1bac602630c5a83141f8517a4a543  ytnef-1.9.3.tar.gz
bf829bd56fff81f30ad32da4714677224b537cf38fb084afe73fd2d5723f73741e0423149832d9f61c0e368781040fd29e66f22c1c6c099d6d300f0649d6ba47  ytnef-pkgconfig.patch"
